package Review;


public class Test42a {

	public static void main(String[] args) {
		char[] ch={'a','b','c','d','e','f','g'};
		reverse(ch,2);
	}
	public static void reverse(char[] ch,int index){
		if(ch==null||ch.length<index+1){
			return;
		}
		reverse(ch, 0,index-1);
		reverse(ch, index,ch.length-1);
		reverse(ch, 0,ch.length-1);
		for(int i=0;i<ch.length;i++){
			System.out.print(ch[i]);
		}
	}
	public static void reverse(char[] ch,int start,int end){
		if(start==end){
			return;
		}
		while(start<end){
			char temp = ch[start];
			ch[start] = ch[end];
			ch[end] = temp;
			start++;
			end--;
		}
	}
	

}
